import type { AppRouteModule } from '/@/router/types';

import { LAYOUT } from '/@/router/constant';
const IFrame = () => import('/@/views/sys/iframe/FrameBlank.vue');
import { t } from '/@/hooks/web/useI18n';
import { useGlobSetting } from '/@/hooks/setting';
const globSetting = useGlobSetting();
const iframe: AppRouteModule = {
  path: '/frame',
  name: 'Frame',
  component: LAYOUT,
  redirect: '/frame/doc',
  meta: {
    orderNo: 10000,
    icon: 'ion:tv-outline',
    roles: ['Admin'],
    userGroups: ['Admin'],
    title: t('routes.demo.iframe.frame'),
  },

  children: [
    {
      path: 'doc',
      name: 'Doc',
      component: IFrame,
      meta: {
        roles: ['Admin'],
        userGroups: ['Admin'],
        frameSrc: `${globSetting.apiBaseUrl}/api/v1/swagger/index.html`,
        title: t('routes.demo.iframe.doc'),
      },
    },
    {
      path: 'apk-upload',
      name: 'apk-upload',
      component: () => import('/@/views/sys/iframe/apkUpload.vue'),
      meta: {
        roles: ['Admin'],
        userGroups: ['Admin'],
        title: '上传APK',
      },
    },
    {
      path: 'hangfire',
      name: 'hangfire',
      component: IFrame,
      meta: {
        roles: ['Admin'],
        userGroups: ['Admin'],
        frameSrc: `${globSetting.apiBaseUrl}/hangfire/`,
        title: '定时任务',
      },
    },
    // {
    //   path: 'https://vvbin.cn/doc-next/',
    //   name: 'DocExternal',
    //   component: IFrame,
    //   meta: {
    //     title: t('routes.demo.iframe.docExternal'),
    //   },
    // },
  ],
};

export default iframe;
